/* ========================================================================= */
/* ------------------------------------------------------------------------- */
/*!		\file		prpex_string.h
  \date		june 2011
  \author		TNick

  \brief		string class


 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Please read ReadMe.txt and Licence.txt in root folder
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


*/
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
#ifndef __PRPEX_STRING_INC__
#define __PRPEX_STRING_INC__
//
//
//
//
/*  INCLUDES    ------------------------------------------------------------ */

#include	<QString>
#include	"prptpl.h"


/*  INCLUDES    ============================================================ */
//
//
//
//
/*  CLASS    --------------------------------------------------------------- */

/// class representing a string
/**
*
*/
class PEX_Str : public PrpTpl		{

	//
	//
	//
	//
	/*  DEFINITIONS    ----------------------------------------------------- */

	/*  DEFINITIONS    ===================================================== */
	//
	//
	//
	//
	/*  DATA    ------------------------------------------------------------ */

private:

	/// this is the value of this item
	QString		str_value;

	/*  DATA    ============================================================ */
	//
	//
	//
	//
	/*  FUNCTIONS    ------------------------------------------------------- */

public:

	/// constructor;
	PEX_Str		(
		PrpMdl*		pa_mdl,		/**< father model */
		PrpNode*	pa_fth,		/**< father item; NULL for top level */
		QString		stra_name,	/**< name of entry */
		QString		stra_descr,	/**< description of entry */
		QString		stra_val	/**< value of entry */
		) : PrpTpl(pa_mdl, pa_fth, PrpTpl::STRING, stra_name, stra_descr)
	{ str_value = stra_val; }

	/// destructor;
	virtual				~PEX_Str		(void) {}

	/// request actual value in text form
	virtual QVariant		valAsText	(void)
	{	return str_value; }
	/// request decoration for the value
	virtual	QVariant		valAsDecor	(void)
	{	return QVariant(); }
	/// request to change the value made by user
	virtual bool			changeVal	(QVariant new_value);
	/// create editor for this type of item
	virtual	QWidget*	editCreate	(
		QWidget *					parent,
		const QStyleOptionViewItem	&option
		);
	/// load data from item to editor
	virtual	void		editLoad	(
		QWidget *					editor
		);
	/// save data from editor to item
	virtual	void		editSave	(
		QWidget *					editor
		);
//	/// update geometry for the editor
//	virtual	void		editResize	(
//		QWidget *					editor,
//		const QStyleOptionViewItem	&option
//		);


	/// gets the name of this entry
	inline QString		value		(void)
	{ return str_value; }
	/// sets the name of this entry
	inline void			setValue	(QString s_new_value)
	{ str_value = s_new_value; }





	/*  FUNCTIONS    ======================================================= */
	//
	//
	//
	//

};	/*	class PEX_Str	*/

/*  CLASS    =============================================================== */
//
//
//
//
#endif // __PRPEX_STRING_INC__
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
